package view;

import java.io.IOException;
import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;

/**
 * A GUI for MIDlet and mobile versions of the system.
 *
 * @author rhaq
 * @version 1.00 2009-05-09 Initial submission.
 */
public class MobileView implements View
{
	/** The manager of the display and input/output devices of the system. */
	private Display display;

	/** The graphical area where to output all image and game-model interactions. */
	private DWGameCanvas gameCanvas;


	/**
	 * Creates an instance of the GUI used for mobile portable versions of the system. Also
	 * brings into focus the main game canvas.
	 * @param display The manager where to perform all input and outputs.
	 * @throws IOException If any of the required graphics cannot be loaded.
	 */
	public MobileView(MIDlet midlet) throws IOException
	{
		this.display = Display.getDisplay(midlet);
		this.gameCanvas = new DWGameCanvas();

		new Thread(gameCanvas).start();
		display.setCurrent(gameCanvas);
	}
}